package com.hertz.alarm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.hertz.alarm.dao.AbstractEntity;
@Entity
@Table(name = "iris_user", catalog = "app_myiris")
@NamedQueries({
	@NamedQuery(name = IrisUser.GET_BY_TOKEN,query = "from IrisUser where ssoToken=? "),
	@NamedQuery(name = IrisUser.GET_FROM_SSO,query = "from IrisUser where ssoUsername=? and ssoSite=? ")
})
public class IrisUser implements AbstractEntity<Long>,Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 959976423177250535L;
	public static final String GET_BY_TOKEN = "GET_BY_UUID";
	public static final String GET_FROM_SSO = "get_from_sso";
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	@Column(name="sso_site")
	private String ssoSite;
	@Column(name="sso_username")
	private String ssoUsername;
	@Column(name="sso_token")
	private String ssoToken;
	@Column(name="same_uid")
	private Long sameUid;
	private long ctime;
	@Column(name="last_login")
	private long lastLogin;
	@Override
	public Long getId() {
		return id;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	public String getSsoSite() {
		return ssoSite;
	}

	public void setSsoSite(String ssoSite) {
		this.ssoSite = ssoSite;
	}

	public String getSsoUsername() {
		return ssoUsername;
	}

	public void setSsoUsername(String ssoUsername) {
		this.ssoUsername = ssoUsername;
	}

	public String getSsoToken() {
		return ssoToken;
	}

	public void setSsoToken(String ssoToken) {
		this.ssoToken = ssoToken;
	}

	public Long getSameUid() {
		return sameUid;
	}

	public void setSameUid(Long sameUid) {
		this.sameUid = sameUid;
	}

	public long getCtime() {
		return ctime;
	}

	public void setCtime(long ctime) {
		this.ctime = ctime;
	}

	public long getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(long lastLogin) {
		this.lastLogin = lastLogin;
	}
}
